var t = document.querySelector("#toTop");
window.onscroll = function () {
    console.log(document.documentElement.scrollTop < 1000);
    if (document.documentElement.scrollTop > 1000 || document.body.scrollTop > 1000 ) {
        t.style.display = "block";
    }else {
        t.style.display = "none";
    }
}
//点击返回顶部
t.addEventListener('click',function () {
    //让 scrollTo 支持平滑滚动
    window.scrollTo({
        top:0,
        behavior:'smooth'
    })
})

var dt_nav_btn = document.querySelector("#dt-nav-btn");

var dt_nav_content = document.querySelector("#dt-nav-content");

//移入事件
dt_nav_btn.addEventListener("mouseover",function () {
    console.log("谁在上面");
    dt_nav_content.style.display = "block";
})

//移除事件 onmouseout 这个一出时间有BUT，所以替换成了 mouseleave
dt_nav_content.addEventListener("mouseleave",function () {
    console.log("离开了");
    dt_nav_content.style.display = "none";
})
